Use StrongHold
Go 
select ItemCode, sum (Qty) So_luong, count(ItemCode) So_Don_Dat_Hang
from OrderDetails
group by ItemCode

select count(*)
from OrderDetails

select ItemCode, Min(Qty) So_Luong
from OrderDetails
group by ItemCode
Having ItemCode= 'RKSK-B'

select *								-- lay ra gia tri nho hon gia tri RKSK-B
from OrderDetails
where Qty <= (select  Min(Qty) So_Luong
from OrderDetails
group by ItemCode
Having ItemCode= 'RKSK-B')

select ItemCode, OrderNo, sum(Qty)		-- group va tinh tong cua tung hoa don, tung mat hang
from OrderDetails
group by ItemCode,OrderNo with cube

select ItemCode, OrderNo, sum(Qty)		-- group va tinh tong cua Mat hang
from OrderDetails
group by ItemCode,OrderNo with rollup


select A.OrderNo, A.OrderDate, A.CCode, B.Cname, B.CPhone
from OrderMaster as A, Customer as B
where A.CCode = B.CCode


select CName, CPhone, ItemCode, ItemName,  Qty,Rate, (Qty * Rate) as Amount
from OrderDetails	inner join Item			on OrderDetails.ItemCode	= Item.ICode 
					inner join OrderMaster	on OrderMaster.OrderNo		= OrderDetails.OrderNo 
					inner join Customer		on OrderMaster.CCode		= Customer.CCode

where ItemCode like 'STCS%' and CName='Travelite Ltd.'

select Customer.CCode, CName, CPhone, OrderNo, OrderDate 
from Customer	right  outer join OrderMaster	on OrderMaster.CCode	= Customer.CCode